package com.owen.count.down.latch.simple2;

import java.util.concurrent.CountDownLatch;

public class MyRunnable2 implements Runnable {

    private CountDownLatch countDownLatch;
    private Integer index;

    public MyRunnable2(CountDownLatch countDownLatch,Integer index){
        this.countDownLatch=countDownLatch;
        this.index=index;
    }

    @Override
    public void run() {
        try {
            countDownLatch.await();
            System.out.println("任务"+index+"开始执行！");
            System.out.println("数据库压力测试开始");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
